﻿
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
    </head>
	<script>
		function cors(){
			var xhr2 = new XMLHttpRequest();
			xhr2.open('get', 'http://127.0.0.1:8080/AJAX/cors.req', true);
			xhr2.onloadstart = function(){
				console.log("request start.......");
			}
			xhr2.onload = function(){
				console.log("request onload.......");
				console.log(xhr2.response);
			}
			xhr2.send();
		}
	</script>
    <body>
	   <button id="startBtn" onclick="cors()">ajax访问</button>
    </body>
</html>